import React from 'react'
import { createRoot } from 'react-dom/client'
import App from './App'
import '@scss/index.scss'
import store from '@/store/index'
import { Provider } from 'react-redux'
import dayjs from 'dayjs'
import relativeTime from 'dayjs/plugin/relativeTime'
import 'dayjs/locale/zh-cn'
dayjs.extend(relativeTime)
dayjs.locale('zh-cn')

// 问题是 document.getElementById 方法的返回类型是 HTMLElement | null
// 非 null (!) 断言运算符从类型中删除 null 和 undefined 而不进行任何显式类型检查
const root = createRoot(document.getElementById('root')!)
root.render(
  <Provider store={store}>
    <App></App>
  </Provider>
)
